// pages/notice/noticeContent/noticeContent.js
const db = wx.cloud.database();
const TABLENAME = 'noticeDataList';

Page({

  data: {
    current: 0,
    verticalCurrent: 0,
    noticeData :  {
      openid : "123",
      title : "录用通知",
      communication : "系统",
      time : "2021-10-20 16:04:30",
      content : "你申请的[茂南区家教]兼职己成功录用,恭喜您,加油"
    },
  },

  handleClick() {
    const addCurrent = this.data.current + 1;
    const current = addCurrent > 2 ? 0 : addCurrent;
    this.setData({
      current : current,
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var noticeDataId
    const eventChannel = this.getOpenerEventChannel()
    eventChannel.on('noticeDataId', function(res) {
      noticeDataId = res.data;
    })

    db.collection(TABLENAME).doc(noticeDataId).get({
      success:res =>{
        console.log(res.data)
        this.setData({
          noticeData : res.data
        })
      }
    })

  },


})